package com.david.andserver;

import com.yanzhenjie.andserver.annotation.GetMapping;
import com.yanzhenjie.andserver.annotation.RequestParam;
import com.yanzhenjie.andserver.annotation.RestController;

@RestController
public class UserController {
    @GetMapping("/user/login")
    String login(@RequestParam("account") String account,
                 @RequestParam("password") String password) {
        if("123".equals(account) && "123".equals(password)) {
            return "Login successful.";
        } else {
            return "Login failed.";
        }
    }

//    @PostMapping("/user/get")
//    User login(@RequestParam("id") String id) {
//        User user = new User();
//        user.setId(id);
//        user.setName("AndServer");
//        return user;
//    }
}